﻿<%@ Page Title="" Language="C#"   MasterPageFile="~/PortalParts/PageMore.Master" AutoEventWireup="true" CodeBehind="PartySubject.aspx.cs" Inherits="ZHDJ.Web.Portal.Edu.PartySubject" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate" />
    <script type="text/javascript">
        $(function () {
            if ($("#ctl00_ContentPlaceHolder1_hdAnswer").val() != "") {
                //做题后
                var Answerstrs = new Array(); //定义一数组 
                Answerstrs = $("#ctl00_ContentPlaceHolder1_hdAnswer").val().split(","); //字符分割 
                $.each(Answerstrs, function (i, n) {
                    $("#lable" + n).css({ color: "red" });
                });

                var Submitstrs = new Array(); //定义一数组 
                Submitstrs = $("#ctl00_ContentPlaceHolder1_hdSubmit").val().split(","); //字符分割 
                $.each(Submitstrs, function (i, n) {
                    $("#" + n).attr("checked", true);

                });
                $("input", '.onesubject_Options').attr("disabled", true);
                return;
            }

            $("#btnSubmit").click(function () {
                var rs = check();
                if (rs) {
                    $(this).attr("disabled", true);
                    $(this).removeClass("red").addClass("gray_disabled");
                    $("#ctl00_ContentPlaceHolder1_btnSubmitEx").click();
                }
                else {
                    alert("请完成已标红的题目！");
                }
            });

        });
        function check() {
            var rs = true;
            $(".onesubject").each(function (i, n) {
                if ($("input:checked", $(n)).length < 1) {
                    rs = false;
                    $(".onesubject_title", $(n)).css({ color: "red" });//标红
                } else {
                    $(".onesubject_title", $(n)).css({ color: "#000" });//标红
                }
            });
            return rs;
        }
        function dataError() {
            alert("提交失败，数据异常");
            location.href = location.href;
        }

        function loadError() {
            alert("加载题目失败，数据异常");
            location.href = location.href;
        }
        function chongfuError(SpecialFlag, Category) {
            alert("此套测试题已提交，请勿重复答题。");
            location.href = "PartyTest.aspx?SpecialFlag=" + SpecialFlag + "&category=" + Category;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="ny_box" style="min-height: 600px">
        <div runat="server" id="divRs" visible="false">
            <div style="text-align: center; color: red; font-size: 18px">
                <asp:Literal runat="server" ID="litRs"></asp:Literal>
            </div>
            <div style="text-align: center">
                <a class="button red" href="PartySubject.aspx?SpecialFlag=<%=SpecialFlag %>&category=<%=Category %>">继续答题</a>
                <a class="button red" style="margin-left: 30px" href="PartyTest.aspx?SpecialFlag=<%=SpecialFlag %>&category=<%=Category %>">返回首页</a>
            </div>
        </div>
        <asp:Repeater runat="server" ID="rptSubject" OnItemDataBound="rptSubject_ItemDataBound">
            <ItemTemplate>
                <div class="onesubject">
                    <div class="onesubject_title">
                        <%# Container.ItemIndex+1 %>、<%#Eval("Subjectcontent") %>
                        <asp:HiddenField runat="server" ID="hdSubjectID" Value='<%#Eval("ID") %>' />
                    </div>
                    <div>
                        <asp:Repeater runat="server" ID="rptOptions">
                            <ItemTemplate>
                                <div class="onesubject_Options">
                                    <input id="<%#Eval("ID") %>" name="<%#Eval("ID") %>" type="checkbox" /><label id="lable<%#Eval("ID") %>" for="<%#Eval("ID") %>"><%#  _leter[Container.ItemIndex]+"、"+ Eval("OptionsContent") %></label>
                                </div>

                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                </div>
            </ItemTemplate>
        </asp:Repeater>
        <asp:HiddenField runat="server" ID="hdSubjectIDs" />
        <asp:HiddenField runat="server" ID="hdAnswer" Value="" />
        <asp:HiddenField runat="server" ID="hdSubmit" Value="" />
        <div class="mysubmitbtn" runat="server" id="divbtnsubmit" style="text-align: center;margin-top: 50px;">
            <input type="button" class="mybtn" id="btnSubmit" value="提交" />
            <div style="display: none">
                <asp:Button runat="server" ID="btnSubmitEx" OnClick="btnSubmitEx_Click" Text="提交" />
            </div>
        </div>
    </div>
</asp:Content>
